<?php
   header('Content-Type:text/html;charset=utf-8');
    $db=new mysqli('localhost','root','','db_emp',3306);
    if ($db->connect_error)
    {
        die("连接失败,失败的原因是".$db->connect_error);
    }
  /*echo "连接成功！";*/
    $db->query("set names utf8");
    $sql="select * from tb_emp";
    $result=$db->query($sql); 
    $sum=$result->num_rows;
    $list=$result->fetch_all(MYSQLI_BOTH); 
?>

